package com.mdxq.mall.sale.service.impl;

import com.mybatisflex.core.util.UpdateEntity;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import com.mdxq.mall.sale.entity.FlashPromotion;
import com.mdxq.mall.sale.mapper.FlashPromotionMapper;
import com.mdxq.mall.sale.service.FlashPromotionService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * 限时购表 服务层实现。
 *
 * @author zdy
 * @since 2025-01-12
 */
@Service
public class FlashPromotionServiceImpl extends ServiceImpl<FlashPromotionMapper, FlashPromotion>  implements FlashPromotionService{

    @Override
    @Transactional
    public boolean updateStatus(Long id, Integer status) {
        FlashPromotion flashPromotion = UpdateEntity.of(FlashPromotion.class,id);
        flashPromotion.setStatus(status);
        mapper.update(flashPromotion,true);
        return true;
    }
}
